package com.itheima.dao;

import com.itheima.domain.Department;
import com.itheima.domain.Patient;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author LiuJie
 * 我亦无他,唯手熟尔
 */

public interface UserDao {
    @Select("select * from tb_department")
    List<Department> queryDepartment();
    @Insert("insert into tb_patient(name, gender, did) value(#{name}, #{gender}, #{did});")
    Boolean addPatient(Patient patient);

    List<Patient> queryPatientByName(Integer pageNum, Integer pageSize, String patientName);

    long countAllPatientByName(String patientName);

    List<Patient> queryPatientByPage(Integer pageNum, Integer pageSize);
    @Select("select count(*) from tb_patient")
    long countAllPatient();

}
